package com.xbongbong.saas.enums;


import com.xbongbong.i18n.util.I18nMessageUtil;
import com.xbongbong.paas.enums.bi.XbbTableRefEnum;
import com.xbongbong.pro.enums.DistributorMarkEnum;
import com.xbongbong.pro.enums.SaasMarkEnum;
import com.xbongbong.saas.constant.BasicConstant;
import lombok.Getter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;


/**
 * 系统中各业务对应的数值，以后其他的业务数值相关的枚举都将是此枚举的子集（历史数据将会有一次大的处理，将我们系统底层的枚举统一起来）
 *
 * @author 张海镔
 * 创建时间：2019/1/25 10:47
 * @version 1.0
 * @since 1.0
 */
@Getter
public enum XbbRefTypeEnum {
    //应用 0XX
    //客户 1XX
    //合同 2XX
    //机会 3XX
    //联系人 4XX
    //跟进记录 5XX
    //访客计划 6XX
    //回款 7XX
    //付款 8XX
    //发票 9XX
    //供应商 10XX
    //采购合同 11XX
    //采购退货 12XX
    //装配出入库单 13XX
    //入库单 14XX
    //出库单 15XX
    //盘点单 16XX
    //调拨单 17XX
    //仓库 18XX
    //库存查询 19XX
    //签到 20XX
    //工作报告 21XX
    //审批 22XX
    //工单 23XX
    //产品 24XX
    //库存产品 25XX
    //BOM清单 26XX
    //模拟生产 27XX
    //生产单 28XX
    //图表 29XX
    //业绩目标 30XX
    //智能报表 31XX
    //销售简报 32XX
    //短信 33XX
    //销售自动化 34XX
    //应用中心 35XX
    //呼叫中心 36XX
    //导入导出 37XX
    //设置 38XX
    //资金管理 39XX
    //
    //套餐 40XX
    //邀请员工 41XX
    //数据接口（API） 42XX
    //公司人数 43XX
    //搜客 46XX
    //报价单 47XX
    //期初库存 48XX
    //资金账户流水 49XX
    //费用管理 50XX
    //新回款计划 53XX
    //客户对账单 54XX
    //信用管理 55XX
    //在线支付流水 56XX
    //其他收支单 57XX
    //其他收入单 571X
    //其他支出单 575X
    //资金调拨单 58XX
    //成本调整单 59XX
    //e签宝 60XX
    //数据中心（数据预警） 61XX
    //欢迎语 --独立版专用 62XX
    //数据集 63XX
    //AI中心 64XX
    //数据工厂 65XX
    //数据面板 66XX
    //钉钉群、销售群 70XX
    //线索 80XX
    //市场管理 81XX
    //SLA日志 82XX
    //营销、促销相关 90XX
    //经销商 950X
    //订货单 951X

    //1000XX 开始是PAAS部分
    //自定义应用 1001XX
    //自定义菜单 1002XX
    //自定义表单 1003XX
    //自定义流程 1004XX
    //文件存储   1005XX
    //自定义打印 1006XX
    //跨应用（跨应用调取数据） 1007XX
    // 工作流 1008XX

    SYSTEM(0,"enum.xbbRefType.name.system","system"),


    CRM(1,"enum.xbbRefType.name.crm","CRM"),


    JXC(2,"enum.xbbRefType.name.jxc","JXC"),


    WORK_ORDER_CENTER(3,"enum.xbbRefType.name.work_order_center","workOrderCenter"),


    PAAS(4,"enum.xbbRefType.name.paas","paas"),
    /**
     * tb_paas_form_paas_sub_data paas表单子表单
     */
    PAAS_SUBFORM(100301,"enum.xbbRefType.name.paas","paasSubform"),

    PAAS_TEAM(100302, "enum.xbbRefType.name.paas_team", "paasTeam"),

    MARKET_MANAGEMENT(5,"enum.xbbRefType.name.market_management","marketManagement"),

    ORDER_CENTER(6, "enum.xbbRefType.name.order_center","orderCenter"),

    DISTRIBUTOR(7,"enum.xbbRefType.name.distributor","distributor"),

    UNKNOWN(404,"enum.xbbRefType.name.unknown","unknown"),

    //客户
    CUSTOMER_MANAGEMENT(100,"enum.xbbRefType.name.customer_management","customerManagement"),


    CUSTOMER(101,"enum.xbbRefType.name.customer","customer"),


    CUSTOMER_FOCUS(102,"enum.xbbRefType.name.customer_focus","customerFocus"),


    CUSTOMER_DEAL(103,"enum.xbbRefType.name.customer_deal","customerDeal"),


    CUSTOMER_FOLLOW(104,"enum.xbbRefType.name.customer_follow","customerFollow"),


    CUSTOMER_PUBLIC(105,"enum.xbbRefType.name.customer_public","customerPublic"),


    CUSTOMER_RECYCLE(106,"enum.xbbRefType.name.customer_recycle","customerRecycle"),


    CUSTOMER_NEARBY(107,"enum.xbbRefType.name.customer_nearby","customerNearby"),


    CUSTOMER_STAGE(108,"enum.xbbRefType.name.customer_stage","customerStage"),


    CUSTOMER_DUPLICATE(109,"enum.xbbRefType.name.customer_duplicate","customerDuplicate"),


    CUSTOMER_BACK_REMIND(110,"enum.xbbRefType.name.customer_back_remind","customer_back_remind"),


    CUSTOMER_REMIND(111,"enum.xbbRefType.name.customer_remind","customerRemind"),


    CUSTOMER_TEAM(112,"enum.xbbRefType.name.customer_team","customerTeam"),

    //客户自定义指标 特殊类型,
    CUSTOMER_INDEX(113,"enum.xbbRefType.name.customer_index","customerIndex"),

    /**
     * 客户子表单
     */
    CUSTOMER_SUBFORM(114,"enum.xbbRefType.name.customer_subform","customerSubform"),

    /**
     * 客户转移公海池
     */
    CUSTOMER_TRANSFER(115,"enum.xbbRefType.name.customer_transfer","customerTransfer"),
    /**
     * 客户转移公海池提醒
     */
    CUSTOMER_TRANSFER_REMIND(116,"enum.xbbRefType.name.customer_transfer_remind","customerTransferRemind"),


    //合同
    CONTRACT(201,"enum.xbbRefType.name.contract","contract"),

    //退货退款
    REFUND(202,"enum.xbbRefType.name.refund","refund"),


    CONTRACT_REMIND(203,"enum.xbbRefType.name.contract_remind","contractRemind"),


    CONTRACT_PRODUCT(204,"enum.xbbRefType.name.contract_product","contract_product"),


    CONTRACT_TEAM(205,"enum.xbbRefType.name.contract_team","contractTeam"),


    CONTRACT_PERFORMANCE(206,"enum.xbbRefType.name.contract_performance","contract_performance"),


    REFUND_TEAM(207,"enum.xbbRefType.name.refund_team","refundTeam"),
    /**
     * 退货退款子表单
     */
    REFUND_SUBFORM(208,"enum.xbbRefType.name.refund_subform","refundSubform"),

    /**
     * 合同子表单
     */
    CONTRACT_SUBFORM(209,"enum.xbbRefType.name.contract_subform","contractSubform"),

    CONTRACT_STAGE(210,"enum.xbbRefType.name.contract_stage","contractStage"),

    //机会
    SALES_OPPORTUNITY(301,"enum.xbbRefType.name.sales_opportunity","salesOpportunity"),


    ALL_OPPORTUNITY(302,"enum.xbbRefType.name.all_opportunity","allOpportunity"),


    KEY_OPPORTUNITY(303,"enum.xbbRefType.name.key_opportunity","keyOpportunity"),


    SALE_STAGE(304,"enum.xbbRefType.name.sale_stage","saleStage"),


    SALES_OPPORTUNITY_TEAM(305,"enum.xbbRefType.name.sales_opportunity_team","salesOpportunityTeam"),


    SALES_OPPORTUNITY_PRODUCT(306,"enum.xbbRefType.name.sales_opportunity_product","salesOpportunityProduct"),

    /**
     * 机会子表单
     */
    SALES_OPPORTUNITY_SUBFORM(307,"enum.xbbRefType.name.sales_opportunity_subform","salesOpportunitySubform"),


    SALES_OPPORTUNITY_DUPLICATE(308,"enum.xbbRefType.name.sales_opportunity_duplicate","salesOpportunityDuplicate"),

    //联系人
    CONTACT(401,"enum.xbbRefType.name.contact","contact"),


    CONTACT_TEAM(402,"enum.xbbRefType.name.contact_team","contactTeam"),
    /**
     * 联系人子表单
     */
    CONTACT_SUBFORM(403,"enum.xbbRefType.name.contact_subform","contactSubform"),
    /**
     * 客户查重
     */
    CONTACT_DUPLICATE(405,"enum.xbbRefType.name.contact_duplicate","contactDuplicate"),
    /**
     * 项目决策信息
     */
    PROJECT_DECISION_INFO(406,"enum.xbbRefType.name.project_decision_info","projectDecisionInfo"),

    // 跟进记录
    CUSTOMER_COMMUNICATE(501,"enum.xbbRefType.name.customer_communicate","customerCommunicate"),

    // 供应商跟进记录
    SUPPLIER_COMMUNICATE(502,"enum.xbbRefType.name.supplier_communicate","supplierCommunicate"),

    //详情新建跟进记录
    DETAIL_CUSTOMER_COMMUNICATE(503,"enum.xbbRefType.name.detail_customer_communicate","detailCustomerCommunicate"),


    DETAIL_CONTRACT_COMMUNICATE(504,"enum.xbbRefType.name.detail_contract_communicate","detailContractCommunicate"),


    DETAIL_OPPORTUNITY_COMMUNICATE(505,"enum.xbbRefType.name.detail_opportunity_communicate","detailOpportunityCommunicate"),


    DETAIL_CONTACT_COMMUNICATE(506,"enum.xbbRefType.name.detail_contact_communicate","detailContactCommunicate"),

    //详情新建跟进记录
    DETAIL_SUPPLIER_COMMUNICATE(507,"enum.xbbRefType.name.detail_supplier_communicate","detailSupplierCommunicate"),


    DETAIL_PURCHASE_COMMUNICATE(508,"enum.xbbRefType.name.detail_purchase_communicate","detailPurchaseCommunicate"),


    DETAIL_QUOTATION_COMUNICATE(509,"enum.xbbRefType.name.detail_quotation_comunicate","detailQuotationCommunicate"),

    DETAIL_CLUE_COMUNICATE(520,"enum.xbbRefType.name.detail_clue_comunicate","detailClueCommunicate"),

    /**
     * 客户跟进记录子表单
     */
    CUSTOMER_COMMUNICATE_SUBFORM(510,"enum.xbbRefType.name.customer_communicate_subform","customerCommunicateSubform"),
    /**
     * 供应商跟进记录子表单
     */
    SUPPLIER_COMMUNICATE_SUBFORM(511,"enum.xbbRefType.name.supplier_communicate_subform","supplierCommunicateSubform"),
    //访客计划
    COMMUNICATE_PLAN(601,"enum.xbbRefType.name.communicate_plan","communicatePlan"),


    COMMUNICATE_PLAN_TEAM(602,"enum.xbbRefType.name.communicate_plan_team","communicatePlanTeam"),
    /**
     * 访客计划子表单
     */
    COMMUNICATE_PLAN_SUBFORM(603,"enum.xbbRefType.name.communicate_plan_subform","communicatePlanSubform"),

    //回款
    PAYMENT_MANAGEMENT(700,"enum.xbbRefType.name.payment_management","paymentManagement"),

    //应收款，下面的红冲应收款RED_RECEIVABLES本质也是应收款
    PAYMENT(701,"enum.xbbRefType.name.payment","payment"),
    //回款单，已核销
    PAYMENT_SHEET(702,"enum.xbbRefType.name.payment_sheet","paymentSheet"),

    //红冲回款单分成三种，该类型代表红冲已核销
    RED_PAYMENT_SHEET(703,"enum.xbbRefType.name.red_payment_sheet","redPaymentSheet"),
    //坏账
    BAD_DEBT(704,"enum.xbbRefType.name.bad_debt","badDebt"),

    PAYMENT_REMIND(705,"enum.xbbRefType.name.payment_remind","paymentRemind"),


    PAYMENT_OVERDUE(706,"enum.xbbRefType.name.payment_overdue","paymentOverdue"),


    PAYMENT_TEAM(707,"enum.xbbRefType.name.payment_team","paymentTeam"),


    //回款单内的 预收款类型
    PREPAYMENT(708,"enum.xbbRefType.name.prepayment","prepayment"),
    //预收款核销
    WRITE_OFF_PREPAYMENT(709,"enum.xbbRefType.name.write_off_prepayment","writeOffPrepayment"),
    //红冲预收款核销
    RED_WRITE_OFF_PREPAYMENT(710,"enum.xbbRefType.name.red_write_off_prepayment","redWriteOffPrepayment"),
    //红冲预收款余额
    RED_PREPAYMENT(711,"enum.xbbRefType.name.red_prepayment","redPrepayment"),
    //预收款列表（做成了表单形式，因此需要独立一个枚举），做成菜单
    PREPAYMENT_BALANCE(712,"enum.xbbRefType.name.prepayment_balance","prepaymentBalance"),


    PREPAYMENT_BALANCE_TEAM(713,"enum.xbbRefType.name.prepayment_balance_team","prepaymentBalanceTeam"),


    PAYMENT_SHEET_TEAM(714,"enum.xbbRefType.name.payment_sheet_team","paymentSheetTeam"),

    //红冲应收款：本质也是应收款
    RED_RECEIVABLES(715,"enum.xbbRefType.name.red_receivables","redReceivables"),
    /**
     * 回款单子表单
     */
    PAYMENT_SHEET_SUBFORM(716,"enum.xbbRefType.name.payment_sheet_subform","paymentSheetSubform"),

    /**
     * 回款计划子表单
     */
    PAYMENT_SUBFORM(717,"enum.xbbRefType.name.payment_subform","paymentSubform"),
    //红冲预收款核销(退到余额)
    RED_WRITE_OFF_BALANCE(718,"enum.xbbRefType.name.red_write_off_balance","redWriteOffBalance"),

    //付款
    PAY_MANAGEMENT(800,"enum.xbbRefType.name.pay_management","payManagement"),

    PAY_PLAN(801,"enum.xbbRefType.name.pay_plan","payPlan"),
    //付款单，已核销
    PAY_SHEET(802,"enum.xbbRefType.name.pay_sheet","paySheet"),

    PAY_PLAN_TEAM(803,"enum.xbbRefType.name.pay_plan_team","payPlanTeam"),
    //预付款核销
    WRITE_OFF_PREPAY(804, "enum.xbbRefType.name.write_off_prepay", "writeOffPrepay"),
    //预付款
    PREPAY(805, "enum.xbbRefType.name.prepay", "prepay"),
    //红冲已核销
    RED_WRITE_OFF_PAY(806, "enum.xbbRefType.name.red_write_off_pay", "redWriteOffPay"),
    //红冲预付款核销
    RED_WRITE_OFF_PREPAY(807, "enum.xbbRefType.name.red_write_off_prepay", "redWriteOffPrepay"),
    //红冲预付款余额
    RED_PREPAY(808, "enum.xbbRefType.name.red_prepay", "redPrepay"),
    //坏账
    BAD_PAY(809, "enum.xbbRefType.name.bad_pay", "badPay"),

    //预付款列表（做成了表单形式，因此需要独立一个枚举），做成菜单
    PREPAY_BALANCE(810,"enum.xbbRefType.name.prepay_balance","prepayBalance"),
    PREPAY_BALANCE_TEAM(811,"enum.xbbRefType.name.prepay_balance_team","prepayBalanceTeam"),

    PAY_PLAN_REMIND(812, "enum.xbbRefType.name.pay_plan_remind", "payPlanRemind"),
    PAY_PLAN_OVERDUE(813, "enum.xbbRefType.name.pay_plan_overdue", "payPlanOverdue"),
    PAY_SHEET_TEAM(814, "enum.xbbRefType.name.pay_sheet_team", "payPlanSheetTeam"),
    /**
     * 付款单子表单
     */
    PAY_SHEET_SUBFORM(815,"enum.xbbRefType.name.pay_sheet_subform","paySheetSubform"),
    /**
     * 付款计划
     */
    PAY_PLAN_SUBFORM(816,"enum.xbbRefType.name.pay_plan_subform","payPlanSubform"),
    //发票
    INVOICE(901,"enum.xbbRefType.name.invoice","invoice"),


    RED_INVOICE(902,"enum.xbbRefType.name.red_invoice","redInvoice"),

    PURCHASE_INVOICE(903,"enum.xbbRefType.name.purchase_invoice","purchaseInvoice"),

    RED_PURCHASE_INVOICE(904,"enum.xbbRefType.name.red_purchase_invoice","redPurchaseInvoice"),
    /**
     * 发票子表单
     */
    INVOICE_SUBFORM(905,"enum.xbbRefType.name.invoice_subform","invoiceSubform"),
    /**
     * 进项发票子表单
     */
    PURCHASE_INVOICE_SUBFORM(906,"enum.xbbRefType.name.purchase_invoice_subform","purchaseInvoiceSubform"),
    /**
     * 销项发票和寄送信息
     */
    INVOICE_EXPRESS(907,"enum.xbbRefType.name.invoice_express","invoiceExpress"),
    /**
     * 进项发票和寄送信息
     */
    PURCHASE_INVOICE_EXPRESS(908,"enum.xbbRefType.name.purchase_invoice_express","purchaseInvoiceExpress"),

    //供应商
    SUPPLIER(1001,"enum.xbbRefType.name.supplier","supplier"),


    SUPPLIER_CONTACT(1002,"enum.xbbRefType.name.supplier_contact","supplierContact"),


    SUPPLIER_TEAM(1003,"enum.xbbRefType.name.supplier_team","supplierTeam"),


    SUPPLIER_CONTACT_TEAM(1004,"enum.xbbRefType.name.supplier_contact_team","supplierContactTeam"),


    SUPPLIER_PRODUCT(1005,"enum.xbbRefType.name.supplier_product","supplierProduct"),
    /**
     * 供应商联系人子表单
     */
    SUPPLIER_CONTACT_SUBFORM(1006,"enum.xbbRefType.name.supplier_contact_subform","supplierContactSubform"),
    /**
     * 供应商子表单
     */
    SUPPLIER_SUBFORM(1007,"enum.xbbRefType.name.supplier_subform","supplierSubform"),

    //采购合同
    PURCHASE_MANAGEMENT(1100,"enum.xbbRefType.name.purchase_management","purchaseManagement"),


    PURCHASE(1101,"enum.xbbRefType.name.purchase","purchase"),


    WAIT_PURCHASE(1102,"enum.xbbRefType.name.wait_purchase","wait_purchase"),

    PURCHASE_TEAM(1103,"enum.xbbRefType.name.purchase_team","purchaseTeam"),


    PURCHASE_PRODUCT(1104,"enum.xbbRefType.name.purchase_product","purchaseProduct"),


    WAIT_PURCHASE_CONTRACT(1105,"enum.xbbRefType.name.wait_purchase_contract","wait_purchase_contract"),


    WAIT_PURCHASE_PRODUCT(1106,"enum.xbbRefType.name.wait_purchase_product","wait_purchase_product"),
    /**
     * 采购合同子表单
     */
    PURCHASE_SUBFORM(1107,"enum.xbbRefType.name.purchase_subform","purchaseSubform"),

    /**
     * 智能补货
     */
    SMART_REPLENISHMENT(1108,"enum.xbbRefType.name.smart_replenishment","smartReplenishment"),

    //采购退货
    RETURNED_PURCHASE(1201,"enum.xbbRefType.name.returned_purchase","returnedPurchase"),


    RETURNEDPURCHASE_PRODUCT(1202,"enum.xbbRefType.name.returnedpurchase_product","returnedPurchase_product"),
    /**
     * 采购退货子表单
     */
    RETURNED_PURCHASE_SUBFORM(1203,"enum.xbbRefType.name.returned_purchase_subform","returnedPurchaseSubform"),
    //库存管理
    INVENTORY_MANAGEMENT(1300,"enum.xbbRefType.name.inventory_management","inventoryManagement"),

    //装配出入库单
    ASSEMBLE(1301,"enum.xbbRefType.name.assemble","assemble"),


    ASSEMBLE_PRODUCT(1302,"enum.xbbRefType.name.assemble_product","assemble_product"),


    ASSEMBLE_INPRODUCTS(1303,"enum.xbbRefType.name.assemble_inproducts","assembleInProducts"),
    /**
     * 装配出入库单子表单
     */
    ASSEMBLE_SUBFORM(1304,"enum.xbbRefType.name.assemble_subform","assembleSubform"),

    //入库单
    INSTOCK(1401, "enum.xbbRefType.name.instock", "instockManagement"),
    INSTOCK_PRODUCT(1402, "enum.xbbRefType.name.instock_product", "instock_product"),
    WAIT_INSTOCK_PURCHASE(1403,"enum.xbbRefType.name.wait_instock_purchase","wait_instock_purchase"),
    // 采购入库单
    PURCHASE_INSTOCK(1404, "enum.xbbRefType.name.purchase_instock", "purchaseInstock"),
    // 销售退货入库单
    REFUND_INSTOCK(1405, "enum.xbbRefType.name.refund_instock", "refundInstock"),
    // 其他入库单
    OTHER_INSTOCK(1406, "enum.xbbRefType.name.other_instock", "instock"),
    // 生产入库单
    PRODUCTION_INSTOCK(1407, "enum.xbbRefType.name.production_instock", "productionInstock"),
    // 生产退料单
    RETURNED_MATERIEL_INSTOCK(1408, "enum.xbbRefType.name.returned_materiel_instock", "returnedMaterielInstock"),
    /**
     * 入库单子表单
     */
    INSTOCK_SUBFORM(1409, "enum.xbbRefType.name.instock_subform", "instockSubform"),
    //出库单
    OUTSTOCK(1501, "enum.xbbRefType.name.outstock", "outstockManagement"),
    OUTSTOCK_PRODUCT(1502, "enum.xbbRefType.name.outstock_product", "outstock_product"),
    WAIT_OUTSTOCK(1503,"enum.xbbRefType.name.wait_outstock","wait_outstock"),
    // 销售出库单
    CONTRACT_OUTSTOCK(1504, "enum.xbbRefType.name.contract_outstock", "contractOutstock"),
    // 采购退货出库单
    RETURNED_PURCHASE_OUTSTOCK(1505, "enum.xbbRefType.name.returned_purchase_outstock", "returnedPurchaseOutstock"),
    // 其他出库单
    OTHER_OUTSTOCK(1506, "enum.xbbRefType.name.other_outstock", "outstock"),
    // 生产领料单
    PRODUCTION_MATERIEL_OUTSTOCK(1507, "enum.xbbRefType.name.production_materiel_outstock", "productionMaterielOutstock"),
    // 工单出库单
    WORK_ORDER_OUTSTOCK(1508, "enum.xbbRefType.name.work_order_outstock", "workOrderOutstock"),
    /**
     * 出库单子表单
     */
    OUTSTOCK_SUBFORM(1509, "enum.xbbRefType.name.outstock_subform", "outstockSubform"),

    //调拨单
    TRANSFER(1601,"enum.xbbRefType.name.transfer","transfer"),


    TRANSFER_PRODUCT(1602,"enum.xbbRefType.name.transfer_product","transfer_product"),
    /**
     * 调拨单子表单
     */
    TRANSFER_SUBFORM(1603,"enum.xbbRefType.name.transfer_subform","transferSubform"),

    //盘点单
    INVENTORY(1701,"enum.xbbRefType.name.inventory","inventory"),


    INVENTORY_PRODUCT(1702,"enum.xbbRefType.name.inventory_product","inventory_product"),
    /**
     * 盘点单子表单
     */
    INVENTORY_SUBFORM(1703,"enum.xbbRefType.name.inventory_subform","inventorySubform"),

    //仓库
    WAREHOUSE(1801,"enum.xbbRefType.name.warehouse","warehouse"),


    WAREHOUSE_PRODUCT(1802,"enum.xbbRefType.name.warehouse_product","warehouse_product"),


    WAREHOUSE_TEAM(1803,"enum.xbbRefType.name.warehouse_team","warehouseTeam"),
    /**
     * 仓库子表单
     */
    WAREHOUSE_SUBFORM(1804,"enum.xbbRefType.name.warehouse_subform","warehouseSubform"),

    //库存查询
    STOCK_SEARCH(1901,"enum.xbbRefType.name.stock_search","stockSearch"),

    // 预警查询
    WARNING_SEARCH(1902,"enum.xbbRefType.name.warning_search","warningSearch"),


    GUARANTEE_SEARCH(1903,"enum.xbbRefType.name.guarantee_search","guaranteeSearch"),

    STOCK_FLOW_BILL(1904, "enum.xbbRefType.name.stock_flow_bill", "stockFlowBill"),

    STOCK_STANDING_BOOK(1905, "enum.xbbRefType.name.stock_standing_book", "stockStandingBook"),

    // 序列号查询 1904、1905被占用
    SEQ_SEARCH(1906,"enum.xbbRefType.name.seq_search","productSerialBalance"),
    // 批次流水
    BATCH_FLOW_BILL(1907, "enum.xbbRefType.name.batch_flow_bill", "batchFlowBill"),
    // 成本调整单
    COST_ADJUST(1908,"enum.xbbRefType.name.cost_adjust","costAdjust"),
    COST_ADJUST_PRODUCT(1909, "enum.xbbRefType.name.cost_adjust_product", "costAdjustProduct"),
    COST_ADJUST_SUBFORM(1910,"enum.xbbRefType.name.cost_adjust_subform","costAdjustSubform"),

    //签到
    SIGNIN(2001,"enum.xbbRefType.name.signin","signIn"),

    //工作报告
    WORK_REPORT(2101,"enum.xbbRefType.name.work_report","workReport"),


    WORKREPORT_DAILY(2102,"enum.xbbRefType.name.workreport_daily","workReportDaily"),


    WORKREPORT_WEEKLY(2103,"enum.xbbRefType.name.workreport_weekly","workReportWeekly"),


    WORKREPORT_MONTHLY(2104,"enum.xbbRefType.name.workreport_monthly","workReportMonthly"),


    WORKREPORT_STATISIC(2105,"enum.xbbRefType.name.workreport_statisic","workReportDailyStatisic"),
    /**
     * 工作报告子表单
     */
    WORK_REPORT_SUBFORM(2106,"enum.xbbRefType.name.work_report_subform","workReportSubform"),

    //审批
    APPROVAL(2201,"enum.xbbRefType.name.approval","approval"),

    //工单
    WORK_ORDER(2301,"enum.xbbRefType.name.work_order","workOrder"),


    WORK_ORDER_TEAM(2302,"enum.xbbRefType.name.work_order_team","workOrderTeam"),


    WORK_ORDER_CC(2303,"enum.xbbRefType.name.work_order_cc","workOrderCc"),


    WORK_ORDER_EVALUATION(2304,"enum.xbbRefType.name.work_order_evaluation","workOrderEvaluation"),


    WORK_ORDER_ROB(2305,"enum.xbbRefType.name.work_order_rob","workOrderRob"),


    WORK_ORDER_OPERATION(2306,"enum.xbbRefType.name.work_order_operation","workOrderOperation"),
    /**
     * 工单子表单
     */
    WORK_ORDER_SUBFORM(2307,"enum.xbbRefType.name.work_order_subform","workOrderSubform"),

    //产品
    PRODUCT(2401, "enum.xbbRefType.name.product", "product"),
    PRODUCT_TEAM(2402, "enum.xbbRefType.name.product_team", "productTeam"),
    PRODUCT_WAREHOUSE(2403, "enum.xbbRefType.name.product_warehouse", "productWarehouse"),
    PRODUCT_STOCK_INFO(2404, "enum.xbbRefType.name.product_stock_info", "productStockInfo"),
    BOMFISH_PRODUCT(2405,"enum.xbbRefType.name.bomfish_product","bomfishProduct"),
    SELECT_PRODUCT(2406,"enum.xbbRefType.name.select_product","selectProduct"),
    /**
     * 产品子表单
     */
    PRODUCT_SUBFORM(2407, "enum.xbbRefType.name.product_subform", "productSubform"),
    PRICE_SET_PRODUCT(2408, "enum.xbbRefType.name.price_product","priceProduct"),
    /**
     * 产品分类
     */
    PRODUCT_CATEGORY(2409, "enum.xbbRefType.name.product_category", "productCategory"),

    //库存产品
    STOCK_PRODUCT(2501,"enum.xbbRefType.name.stock_product","stockProduct"),

    //BOM清单
    BOM_BILL(2601,"enum.xbbRefType.name.bom_bill","bomBill"),


    BOM_BILL_PRODUCT(2602,"enum.xbbRefType.name.bom_bill_product","BOMbill_product"),


    BOM_BILL_TEAM(2603,"enum.xbbRefType.name.bom_bill_team","bomBillTeam"),
    /**
     * bom子表单
     */
    BOM_BILL_SUBFORM(2604,"enum.xbbRefType.name.bom_bill_subform","bomBillSubform"),

    //模拟生产
    SIMULATED_PRODUCTION(2701,"enum.xbbRefType.name.simulated_production","simulatedProduction"),


    PRODUCTION_MANAGEMENT(2800,"enum.xbbRefType.name.production_management","productionManagement"),

    //生产单
    PRODUCTION_ORDER(2801,"enum.xbbRefType.name.production_order","productionOrder"),


    PRODUCTION_ORDER_TEAM(2802,"enum.xbbRefType.name.production_order_team","productionOrderTeam"),


    WAIT_PRODUCE(2803,"enum.xbbRefType.name.wait_produce","wait_produce"),


    PRODUCTION_ORDER_PRODUCT(2804,"enum.xbbRefType.name.production_order_product","productionOrderProduct"),


    WAIT_PRODUCE_CONTRACT(2805,"enum.xbbRefType.name.wait_produce_contract","wait_produce_contract"),


    WAIT_PRODUCE_PRODUCT(2806,"enum.xbbRefType.name.wait_produce_product","wait_produce_product"),

    /**
     * 生产单子表单
     */
    PRODUCTION_ORDER_SUBFORM(2807,"enum.xbbRefType.name.production_order_subform","productionOrderSubform"),
    //图表
    STATISTICS(2901,"enum.xbbRefType.name.statistics","statistics"),

    //业绩目标 30
    PERFORMANCE(3001,"enum.xbbRefType.name.performance","performance"),

    //智能报表 31
    BI_DATA_WAREHOUSE(3101,"enum.xbbRefType.name.bi_data_warehouse","biDataWareHouse"),

    //销售简报
    SALES_REPORT_ENTITY(3201,"enum.xbbRefType.name.sales_report_entity","salesReportEntity"),

    //短信 33
    GROUP_MESSAGE(33,"enum.xbbRefType.name.group_message","groupMessage"),


    SEND_MESSAGE(3301,"enum.xbbRefType.name.send_message","sendMessage"),


    RECORD_VIEW(3302,"enum.xbbRefType.name.record_view","recordView"),


    CONFIG_INFORMATION(3303,"enum.xbbRefType.name.config_information","configInformation"),


    RECHARGE_RECORD(3304,"enum.xbbRefType.name.recharge_record","rechargeRecord"),


    REPLY_VIEW(3305,"enum.xbbRefType.name.reply_view","replyView"),

    //sfa
    AI_ASSISTANT(3401,"enum.xbbRefType.name.ai_assistant","aiAssistant"),


    APP_STORE(3501,"enum.xbbRefType.name.app_store","appStore"),

    //呼叫中心
    CALL_CENTER(3601,"enum.xbbRefType.name.call_center","callCenter"),


    CALL_CENTER_DU_YAN(3602,"enum.xbbRefType.name.call_center_du_yan","duyan"),


    CALL_CENTER_DINGTALK(3603,"enum.xbbRefType.name.call_center_dingtalk","dingtalk"),


    CALL_CENTER_COMMON_CALL(3604,"enum.xbbRefType.name.call_center_common_call","commonCall"),


    CALL_CENTER_XBB(3605,"enum.xbbRefType.name.call_center_xbb","xbb"),


    CALL_CENTER_CALL_LOG(3606,"enum.xbbRefType.name.call_center_call_log","callLog"),

    // 阿里云呼叫中心
    CALL_CENTER_ALI_YUN(3612,"enum.xbbRefType.name.call_center_ali_yun","AICallDetailed"),


    //导入导出
    IMPORT_AND_EXPORT(3700,"enum.xbbRefType.name.import_and_export","importAndExport"),


    EXPORT(3701,"enum.xbbRefType.name.export","export"),


    EXPORT_FAIL(3702,"enum.xbbRefType.name.export_fail","export_fail"),

    //设置 38

    // 资金管理
    FUND_MANAGEMENT(3900,"enum.xbbRefType.name.fund_management","fundManagement"),

    //套餐 40
    SET_MEAL(4000,"enum.xbbRefType.name.set_meal","setMeal"),

    // 跟进提醒
    PUSH_NOTIFY(4100,"enum.xbbRefType.name.push_notify","pushNotify"),

    // 位置
    LOCATION(4200,"enum.xbbRefType.name.location","location"),

    //DING
    DING(4300,"enum.xbbRefType.name.ding","ding"),

    //发布动态
    DYNAMIC(4400,"enum.xbbRefType.name.dynamic","dynamic"),

    /**
     * 用户
     */
    USER(4500,"enum.xbbRefType.name.user","user"),

    //搜客应用
    SEARCH_CUSTOMER(4600,"enum.xbbRefType.name.search_customer","searchCustomer"),


    EXCAVATE_CLUE(4601,"enum.xbbRefType.name.excavate_clue","excavateClue"),


    COLLECTOR(4602,"enum.xbbRefType.name.collector","collector"),


    INDIVIDUAL_CLUE(4603,"enum.xbbRefType.name.individual_clue","individualClue"),


    AUTHORITY_MANAGE(4604,"enum.xbbRefType.name.authority_manage","authorityManage"),


    RECYCLE_BIN(4606,"enum.xbbRefType.name.recycle_bin","recycleBin"),

    QUOTATION(4700, "enum.xbbRefType.name.quotation", "quotation"),
    QUOTATION_TEAM(4701, "enum.xbbRefType.name.quotation_team", "quotationTeam"),
    QUOTATION_PRODUCT(4702, "enum.xbbRefType.name.quotation_product", "quotationProduct"),
    QUOTATION_REMIND(4703, "enum.xbbRefType.name.quotation_remind", "quotationRemind"),
    /**
     * 报价单子表单
     */
    QUOTATION_SUBFORM(4704, "enum.xbbRefType.name.quotation_subform", "quotationSubform"),
    // 期初库存
    ORI_STOCK(4800,"enum.xbbRefType.name.ori_stock","oriStock"),

    /**
     * 资金账户流水
     */
    FUND_ACCOUNT_FLOW(4900,"enum.xbbRefType.name.fund_account_flow","fundAccountFlow"),

    /**
     * 经销商资金账户
     */
    DISTRIBUTOR_FUND_ACCOUNT(4910, "enum.xbbRefType.name.distributor_fund_account", "distributorFundAccount"),
    /**
     * 费用管理
     */
    EXPENSE_MANAGEMENT(5000, "enum.xbbRefType.name.expense_management", "expenseManagement"),
    REIMBURSEMENT_FORM(5100, "enum.xbbRefType.name.reimbursement_form", "reimbursementForm"),
    EXPENSE(5200, "enum.xbbRefType.name.expense_list", "expense"),

    /**
     * 新回款计划
     */
    PAYMENT_TASK(5301, "enum.xbbRefType.name.payment_task", "paymentTask"),
    PAYMENT_TASK_TEAM(5302, "enum.xbbRefType.name.payment_task_team", "paymentTaskTeam"),
    PAYMENT_TASK_SUBFORM(5304, "enum.xbbRefType.name.payment_task_subform", "paymentTaskSubform"),

    /**
     * 客户对账单
     */
    STATEMENT(5400, "enum.xbbRefType.name.statement", "statement"),
    //生成对账单：有隐藏form
    CUSTOMER_STATEMENT(5401,"enum.xbbRefType.name.customer_statement","customerStatement"),
    CUSTOMER_STATEMENT_SNAPSHOT(5402,"enum.xbbRefType.name.customer_statement_snapshot","customerStatementSnapshot"),
    //对账单列表：有隐藏form
    CUSTOMER_STATEMENT_STATISTIC(5403, "enum.xbbRefType.name.statement_list", "customerStatementStatistic"),

    /**
     * 信用管理
     */
    CREDIT_MANAGEMENT(5500,"enum.xbbRefType.name.credit_management","creditManagement"),
    /**
     * 信用额度
     */
    CREDIT_LIMIT(5510,"enum.xbbRefType.name.credit_limit","creditLimit"),
    /**
     * 临时额度申请记录
     */
    CREDIT_TEMPORARY_LIMIT(5520,"enum.xbbRefType.name.credit_temporary_limit","creditTemporaryLimit"),
    CREDIT_TEMPORARY_LIMIT_SUBFORM(5521,"enum.xbbRefType.name.credit_temporary_limit_subform","creditTemporaryLimitSubform"),
    /**
     * 固定额度调整记录
     */
    CREDIT_FIXED_LIMIT(5530,"enum.xbbRefType.name.credit_fixed_limit","creditFixedLimit"),
    CREDIT_FIXED_LIMIT_SUBFORM(5531,"enum.xbbRefType.name.credit_fixed_limit_subform","creditFixedLimitSubform"),
    /**
     * 信用流水
     */
    CREDIT_CARD_BILL(5540,"enum.xbbRefType.name.credit_card_bill","creditCardBill"),

    /**
     * 在线支付流水
     */
    ONLINE_PAYMENT_FLOW(5600, "enum.xbbRefType.name.online_payment_flow", "onlinePaymentFlow"),

    /**
     * 其他收支单
     */
    OTHER_FUND_MANAGEMENT(5700, "enum.xbbRefType.name.other_fund_management", "otherFundManagement"),
    /**
     * 其他收入单
     * 其他收入单的已收款
     */
    OTHER_INCOME(5710, "enum.xbbRefType.name.other_income", "otherIncome"),
    /**
     * 其他收入单的 红冲已收款
     */
    RED_OTHER_INCOME(5711, "enum.xbbRefType.name.red_other_income", "redOtherIncome"),
    /**
     * 其他收入单子表单
     */
    OTHER_INCOME_SUBFORM(5712,"enum.xbbRefType.name.other_income_subform","otherIncomeSubform"),
    /**
     * 其他支出单
     * 其他支出单的已付款
     */
    OTHER_EXPENSE(5750, "enum.xbbRefType.name.other_expense", "otherExpense"),
    /**
     * 其他支出单的 红冲已付款
     */
    RED_OTHER_EXPENSE(5751, "enum.xbbRefType.name.red_other_expense", "redOtherExpense"),
    /**
     * 其他支出单子表单
     */
    OTHER_EXPENSE_SUBFORM(5752,"enum.xbbRefType.name.other_expense_subform","otherExpenseSubform"),
    /**
     * 资金调拨单
     */
    FUND_TRANSFER(5800, "enum.xbbRefType.name.fund_transfer", "fundTransfer"),
    /**
     * 资金调拨单子表单
     */
    FUND_TRANSFER_SUBFORM(5801,"enum.xbbRefType.name.fund_transfer_subform","fundTransferSubform"),
    ESIGN(6000, "enum.xbbRefType.name.esign", "esign"),
    ESIGN_RECHARGE(6001, "enum.xbbRefType.name.esign_recharge", "esignRecharge"),
    ESIGN_CORP_INFO(6002, "enum.xbbRefType.name.esign_corp_info", "esignCorpInfo"),
    ESIGN_OTHER_SET(6003, "enum.xbbRefType.name.esign_other_set", "esignOtherSet"),

    // 数据中心
    DATA_CENTER(6100,"enum.xbbRefType.name.data_center","dataCenter"),

    DATA_WARNING(6101,"enum.xbbRefType.name.data_warning","dataWarning"),

    DATA_SET(6300,"enum.xbbRefType.name.data_set","dataSet"),

    // AI中心
    AI_CENTER(6400,"enum.xbbRefType.name.ai_center","aiCenter"),
    AI_MANAGE(6401,"enum.xbbRefType.name.ai_manage","aiManage"),
    // 数据工厂
    DATA_FACTORY(6500,"enum.xbbRefType.name.data_factory","dataFactory"),
    DATA_OVERVIEW(6501,"enum.xbbRefType.name.data_overview","dataOverview"),
    DATA_IMPORT(6502,"enum.xbbRefType.name.data_import","dataImport"),
    DATA_CALLOUT(6503,"enum.xbbRefType.name.data_callout","dataCallout"),
    TRAIN_MODEL(6504,"enum.xbbRefType.name.train_model","trainModel"),
    LABEL_MANAGE(6505,"enum.xbbRefType.name.label_manage","labelManage"),
    // 数据面板
    DATA_FACEPLATE(6600,"enum.xbbRefType.name.data_faceplate","dataFaceplate"),

    //营销管理
    MARKETING_MANAGEMENT(9000, "enum.xbbRefType.name.marketing_management", "marketingManagement"),
    MARKETING_TOOL(9001, "enum.xbbRefType.name.marketing_tool", "marketingTool"),
    //营销活动
    MARKETING_ACTIVITY(9002, "enum.xbbRefType.name.marketing_activity", "marketingActivity"),
    MARKETING_ACTIVITY_MANAGEMENT(9003, "enum.xbbRefType.name.marketing_activity_management", "marketingActivityManagement"),
    FULL_DISCOUNT_COUPON(9004, "enum.xbbRefType.name.full_discount_coupon", "fullDiscountCoupon"),
    PROMOTION_TOOL(9005, "enum.xbbRefType.name.promotion_tool", "promotionTool"),
    //促销活动
    PROMOTION_ACTIVITY(9006, "enum.xbbRefType.name.promotion_activity", "promotionActivity"),
    PROMOTION_ACTIVITY_MANAGEMENT(9007, "enum.xbbRefType.name.promotion_activity_management", "promotionActivityManagement"),
    SPECIAL_GOODS(9008, "enum.xbbRefType.name.special_product", "specialProducts"),
    WRITE_OFF_RECORD(9009, "enum.xbbRefType.name.write_off_record", "writeOffRecord"),
    DISTRIBUTOR_COUPON(9010, "enum.xbbRefType.name.distributor_coupon", "distributorCoupon"),

    /**
     * 经销商
     */
    DISTRIBUTOR_ACCOUNT(9500, "enum.xbbRefType.name.distributor_account", "account"),
    // 以下经销商type不对外区分（如add接口），只在日志、消息等内部使用时区分
    DISTRIBUTOR_MANAGEMENT(9501, "enum.xbbRefType.name.distributor_management", "distributorManagement"),
    DISTRIBUTOR_CONTACT(9502, "enum.xbbRefType.name.distributor_contact", "distributorContact"),
    DISTRIBUTOR_COMMUNICATE(9503, "enum.xbbRefType.name.distributor_communicate", "distributorCommunicate"),


    /**
     * 订货单 退货单 出库发货单
     */
    //订货单type不对外区分 日志消息权限等内部使用区分
    ORDER(9510,"enum.xbbRefType.name.order","order"),
    RETURN(9511,"enum.xbbRefType.name.return","return"),
    ORDER_OUTSTOCK(9512,"enum.xbbRefType.name.orderOutStock","orderOutStock"),
    DISTRIBUTOR_ORDER(9513, "enum.xbbRefType.name.distributorOrder", "distributorOrder"),

    DYNAMIC_DATA(10000, "enum.xbbRefType.name.dynamic.data", "dynamicData"),
    DEFAULT_DATA(10001, "enum.xbbRefType.name.dynamic.data", "defaultData"),

    BUNDLE(7000,"enum.xbbRefType.name.bundle","bundle"),
    SALE_BUNDLE(7001,"enum.xbbRefType.name.sale_bundle","sale_bundle"),
    COOL_APP(7002,"enum.xbbRefType.name.cool_app","coolApp"),
    /**
     * 市场管理
     */
    CLUE(8000, "enum.xbbRefType.name.clue", "clue"),
    ALL_CLUE(8001, "enum.xbbRefType.name.all_clue", "allClue"),
    CLUE_PUBLIC(8002,"enum.xbbRefType.name.clue_public","cluePublic"),
    CLUE_RECYCLE(8003,"enum.xbbRefType.name.clue_recycle","clueRecycle"),
    CLUE_TEAM(8004, "enum.xbbRefType.name.clue_team", "clueTeam"),
    CLUE_STAGE(8005,"enum.xbbRefType.name.clue_stage","clueStage"),
    CLUE_DUPLICATE(8006,"enum.xbbRefType.name.clue_duplicate","clueDuplicate"),
    CLUE_BACK_REMIND(8007,"enum.xbbRefType.name.clue_back_remind","clueBackRemind"),
    CLUE_SUBFORM(8008,"enum.xbbRefType.name.clue_subform","clueSubform"),
    /**
     * 线索转移公海池
     */
    CLUE_TRANSFER(8009,"enum.xbbRefType.name.clue_transfer","clueTransfer"),
    /**
     * 线索转移公海池提醒
     */
    CLUE_TRANSFER_REMIND(8010,"enum.xbbRefType.name.clue_transfer_remind","clueTransferRemind"),
    MARKET_ACTIVITY(8100, "enum.xbbRefType.name.market_activity", "marketActivity"),
    MARKET_ACTIVITY_TEAM(8101, "enum.xbbRefType.name.market_activity_team", "marketActivityTeam"),
    MARKET_ACTIVITY_SUBFORM(8102,"enum.xbbRefType.name.market_activity_subform","marketActivitySubform"),
    MARKET_ACTIVITY_STATIC(8103,"enum.xbbRefType.name.market_activity_static","marketActivityStatic"),

    //SLA日志
    SLA_LOG(8200,"enum.xbbRefType.name.sla_log","slaLog"),
    SLA_LOG_TEAM(8201,"enum.xbbRefType.name.sla_log_team","slaLogTeam"),
    /**
     * 联系人子表单
     */

    WORKFLOW_SEND_MESSAGE(100800, "enum.xbbRefType.name.workflow_send_message","workflowSendMessage"),

    //精线索应用
    FINE_CLUE(20000,"enum.xbbRefType.name.fine_clue","fineClue"),

    FINE_CLUE_QUERY_COMPANY(20001,"enum.xbbRefType.name.fine_clue_query_company","fineClueQueryCompany"),


    FINE_CLUE_QUERY_CLUE(20002,"enum.xbbRefType.name.fine_clue_query_clue","fineClueQueryClue"),


    FINE_CLUE_MAP_QUERY(20003,"enum.xbbRefType.name.fine_clue_map_query","fineClueMapQuery"),


    FINE_CLUE_BATCH_QUERY(20004,"enum.xbbRefType.name.fine_clue_batch_query","fineClueBatchQuery"),


    FINE_CLUE_PERMISSIONS(20005,"enum.xbbRefType.name.fine_clue_permissions","fineCluePermissions"),

    STAGE_TIMEOUT_REMIND(50005,"enum.xbbRefType.name.stageTimeoutRemind","stageTimeoutRemind"),
    PAAS_STAGE(50006,"enum.xbbRefType.name.paasStage","paasStage"),


    //知识库
    KNOWLEDGE_BASE(20100,"enum.xbbRefType.name.knowledge_base","knowledgeBase"),
    //竞争对手
    COMPETITOR(20200,"enum.xbbRefType.name.competitor","competitor"),
    COMPETITOR_ANALYSIS(20201,"enum.xbbRefType.name.competitor_analysis","competitorAnalysis"),
    COMPETITOR_TEAM(20202, "enum.xbbRefType.name.competitor_team", "competitorTeam"),
    COMPETITOR_SUBFORM(20203,"enum.xbbRefType.name.competitor_subform","competitorSubform"),
    // 合同比对
    CONTRACT_COMPARE(20400,"enum.xbbRefType.name.contractCompare","contractCompare"),
    //
    CONTRACT_COMPARE_RESULT(20500, "enum.xbbRefType.name.contractCompareResult","contractCompareResult"),

    /**
     * 工单2.0 203XX
     */
    //工单中心
    WORK_ORDER_V2_CENTER(20290,"enum.xbbRefType.name.work_order_v2_center","workOrderV2Center"),
    //新工单
    WORK_ORDER_V2(20300,"enum.xbbRefType.name.work_order_v2","workOrderV2"),
    WORK_ORDER_V2_TEAM(20301,"enum.xbbRefType.name.work_order_v2_team","workOrderV2Team"),
    WORK_ORDER_V2_SUBFORM(20302,"enum.xbbRefType.name.work_order_v2_subform","workOrderV2Subform"),
    WORK_ORDER_V2_PRODUCT(20303,"enum.xbbRefType.name.work_order_v2_product","workOrderV2Product"),
    WORK_ORDER_V2_POOL(20304,"enum.xbbRefType.name.work_order_v2_pool","workOrderV2Pool"),
    WORK_ORDER_V2_APPOINT(20305,"enum.xbbRefType.name.work_order_v2_appoint","workOrderV2Appoint"),
    WORK_ORDER_V2_NODE_INFO(20306,"enum.xbbRefType.name.work_order_v2","workOrderV2NodeInfo"),
    ALL_WORK_ORDER_V2(20307,"enum.xbbRefType.name.all_work_order_v2","allWorkOrderV2"),
    WORK_ORDER_V2_NODE_INFO_LOG_ITEM(20308,"enum.xbbRefType.name.work_order_v2","workOrderV2NodeInfoLogItem"),
    //工单设置
    WORK_ORDER_V2_SETTING(20310,"enum.xbbRefType.name.work_order_v2_setting","workOrderV2Setting"),
    //
    WORK_ORDER_V2_CATALOGUE(20311,"enum.xbbRefType.name.all_work_order_v2_catalogue","workOrderV2Catalogue"),
    //SLA规则
    SLA_RULE(20320,"enum.xbbRefType.name.sla_rule","slaRule"),
    //服务项目
    SERVICE_PROJECT(20330,"enum.xbbRefType.name.service_project","serviceProject"),
    SERVICE_PROJECT_TEAM(20331, "enum.xbbRefType.name.service_project_team", "serviceProjectTeam"),
    SERVICE_PROJECT_SUBFORM(20332,"enum.xbbRefType.name.service_project_subform","serviceProjectSubform"),
    //回执单
    RECEIPT_ORDER(20340,"enum.xbbRefType.name.receipt_order","receiptOrder"),
    RECEIPT_ORDER_TEAM(20342,"enum.xbbRefType.name.receipt_order_team","receiptOrderTeam"),
    RECEIPT_ORDER_SUBFORM(20343,"enum.xbbRefType.name.receipt_order_subform","receiptOrderSubform"),
    RECEIPT_ORDER_PRODUCT(20344,"enum.xbbRefType.name.receipt_order_product","receiptOrderProduct"),
    RECEIPT_ORDER_SERVICE(20345,"enum.xbbRefType.name.receipt_order_service","receiptOrderService"),
    //工单节点日志信息(自定义图表)
    WORK_ORDER_V2_NODE_LOG_INFO(20350, "enum.xbbRefType.name.work_order_v2_node_log_info", "workOrderV2NodeLogInfo"),


    CONTRACT_TEMPLATE_BASE(20700,"enum.xbbRefType.name.onlineEditor","onlineEditor"),
    ;

    /**
     * 枚举值 --
     */
    private final int code;

    /**
     * 枚举信息--中文名称
     */
    private final String name;

    /**
     * 枚举描述 --英文名称
     */
    private final String alias;

    /**
     * 构造一个<code>XbbRefTypeEnum</code>枚举对象
     *
     * @param code  枚举Code
     * @param name  枚举名称
     * @param alias 枚举别名
     */
    XbbRefTypeEnum(int code, String name, String alias) {
        this.code = code;
        this.name = name;
        this.alias = alias;
    }

    /**
     * 通过枚举 alias 获得枚举
     *
     * @param alias 枚举别名
     *
     * @return XbbRefTypeEnum
     */
    public static XbbRefTypeEnum getByAlias(String alias) {
        for (XbbRefTypeEnum cacheCode : values()) {
            if (cacheCode.getAlias().equals(alias)) {
                return cacheCode;
            }
        }
        return UNKNOWN;
    }

    /**
     * 通过枚举 code 获得枚举
     *
     * @param code 枚举Code
     *
     * @return XbbRefTypeEnum
     */
    public static XbbRefTypeEnum getByCode(Integer code) {
        for (XbbRefTypeEnum cacheCode : values()) {
            if (Objects.equals(code, cacheCode.getCode())) {
                return cacheCode;
            }
        }
        return UNKNOWN;
    }

    /**
     * 通过客户、机会、线索的业务类型获取对应的阶段类型
     *
     * @param businessType 客户、机会、线索的业务类型
     * @return 阶段类型
     */
    public static Integer transferBusinessTypeToStageType(Integer businessType) {
        if (Objects.equals(businessType, CUSTOMER_MANAGEMENT.getCode())) {
            return CUSTOMER_STAGE.code;
        } else if (Objects.equals(businessType, SALES_OPPORTUNITY.getCode())) {
            return SALE_STAGE.code;
        } else if (Objects.equals(businessType, CLUE.getCode())) {
            return CLUE_STAGE.code;
        } else {
            return UNKNOWN.getCode();
        }
    }

    /**
     * 获取枚举，兼容businessType = 0 或 saasMark = 2
     *
     * @param saasMark
     * @param businessType
     * @return com.xbongbong.saas.enums.XbbRefTypeEnum
     * @author zyy
     * @date 2022/11/15
     * @version v1.0
     */
    public static XbbRefTypeEnum getByFlag(Integer saasMark, Integer businessType) {
        if(Objects.equals(SaasMarkEnum.PAAS.getCode(),saasMark)
                || Objects.equals(businessType, BasicConstant.ZERO)
                || Objects.equals(businessType, PAAS.getCode())){
            return PAAS;
        }else{
            return getByCode(businessType);
        }
    }

    /**
     * 含有formId字段的表单
     *
     * @param xbbTableRefEnum
     * @return boolean
     * @author zyy
     * @date 2022/12/8
     * @version v1.0
     */
    public static boolean supportFormId(XbbTableRefEnum xbbTableRefEnum) {
        return Arrays.asList(
                PAAS,
                PAAS_SUBFORM,
                CUSTOMER_MANAGEMENT,
                CUSTOMER_SUBFORM,
                CONTRACT,
                CONTRACT_SUBFORM,
                CONTRACT_PRODUCT,
                REFUND,
                REFUND_SUBFORM,
                SALES_OPPORTUNITY,
                SALES_OPPORTUNITY_PRODUCT,
                SALES_OPPORTUNITY_SUBFORM,
                CONTACT,
                CONTACT_SUBFORM,
                CUSTOMER_COMMUNICATE,
                CUSTOMER_COMMUNICATE_SUBFORM,
                SUPPLIER_COMMUNICATE,
                SUPPLIER_COMMUNICATE_SUBFORM,
                COMMUNICATE_PLAN,
                COMMUNICATE_PLAN_SUBFORM,
                PAYMENT,
                PAYMENT_SUBFORM,
                PAYMENT_SHEET,
                PAYMENT_SHEET_SUBFORM,
                PAY_PLAN,
                PAY_PLAN_SUBFORM,
                PAY_SHEET,
                PAY_SHEET_SUBFORM,
                INVOICE,
                INVOICE_SUBFORM,
                PURCHASE_INVOICE,
                PURCHASE_INVOICE_SUBFORM,
                SUPPLIER,
                SUPPLIER_SUBFORM,
                SUPPLIER_CONTACT_SUBFORM,
                PURCHASE,
                PURCHASE_SUBFORM,
                RETURNED_PURCHASE,
                RETURNED_PURCHASE_SUBFORM,
                INVENTORY,
                INVENTORY_SUBFORM,
                INVENTORY_PRODUCT,
                ASSEMBLE_SUBFORM,
                INSTOCK,
                INSTOCK_PRODUCT,
                INSTOCK_SUBFORM,
                PURCHASE_INSTOCK,
                REFUND_INSTOCK,
                OTHER_INSTOCK,
                PRODUCTION_INSTOCK,
                RETURNED_MATERIEL_INSTOCK,
                OUTSTOCK,
                OUTSTOCK_SUBFORM,
                OUTSTOCK_PRODUCT,
                CONTRACT_OUTSTOCK,
                RETURNED_PURCHASE_OUTSTOCK,
                OTHER_OUTSTOCK,
                PRODUCTION_MATERIEL_OUTSTOCK,
                WORK_ORDER_OUTSTOCK,
                TRANSFER,
                TRANSFER_PRODUCT,
                TRANSFER_SUBFORM,
                WAREHOUSE,
                WAREHOUSE_SUBFORM,
                WORK_ORDER,
                WORK_ORDER_SUBFORM,
                PRODUCT,
                PRODUCT_SUBFORM,
                BOM_BILL,
                BOM_BILL_SUBFORM,
                PRODUCTION_ORDER,
                PRODUCTION_ORDER_SUBFORM,
                QUOTATION,
                QUOTATION_SUBFORM,
                REIMBURSEMENT_FORM,
                EXPENSE,
                CLUE,
                CLUE_SUBFORM,
                MARKET_ACTIVITY,
                MARKET_ACTIVITY_SUBFORM,
                OTHER_INCOME,
                OTHER_INCOME_SUBFORM,
                OTHER_EXPENSE,
                OTHER_EXPENSE_SUBFORM,
                COMPETITOR,
                COMPETITOR_SUBFORM).contains(xbbTableRefEnum);
    }

    /**
     * 含有flowStatus字段的表单
     *
     * @param xbbTableRefEnum
     * @return boolean
     * @author zyy
     * @date 2022/12/8
     * @version v1.0
     */
    public static boolean supportFlowStatus(XbbTableRefEnum xbbTableRefEnum) {
        return Arrays.asList(
                PAAS,
                CUSTOMER_MANAGEMENT,
                CONTRACT,
                REFUND,
                SALES_OPPORTUNITY,
                CONTACT,
                SUPPLIER_COMMUNICATE,
                SUPPLIER_COMMUNICATE_SUBFORM,
                COMMUNICATE_PLAN,
                PAYMENT,
                PAYMENT_SHEET,
                PAY_PLAN,
                PAY_SHEET,
                INVOICE,
                PURCHASE_INVOICE,
                SUPPLIER,
                SUPPLIER_CONTACT,
                PURCHASE,
                RETURNED_PURCHASE,
                INVENTORY,
                INSTOCK,
                PURCHASE_INSTOCK,
                REFUND_INSTOCK,
                OTHER_INSTOCK,
                PRODUCTION_INSTOCK,
                RETURNED_MATERIEL_INSTOCK,
                OUTSTOCK,
                CONTRACT_OUTSTOCK,
                RETURNED_PURCHASE_OUTSTOCK,
                OTHER_OUTSTOCK,
                PRODUCTION_MATERIEL_OUTSTOCK,
                WORK_ORDER_OUTSTOCK,
                TRANSFER,
                WAREHOUSE,
                WORK_ORDER,
                PRODUCT,
                BOM_BILL,
                PRODUCTION_ORDER,
                QUOTATION,
                REIMBURSEMENT_FORM,
                EXPENSE,
                CLUE,
                MARKET_ACTIVITY,
                OTHER_INCOME,
                OTHER_EXPENSE,
                COMPETITOR).contains(xbbTableRefEnum);
    }

    /**
     * 获取全部枚举
     *
     * @return List<XbbRefTypeEnum>
     */
    public List<XbbRefTypeEnum> getAllEnum() {
        List<XbbRefTypeEnum> list = new ArrayList<>();
        for (XbbRefTypeEnum cache : values()) {
            if (cache == UNKNOWN) {
                continue;
            }
            list.add(cache);
        }
        return list;
    }

    /**
     * 获取全部枚举值
     *
     * @return List<String>
     */
    public List<String> getAllEnumAlis() {
        List<String> list = new ArrayList<>();
        for (XbbRefTypeEnum cache : values()) {
            if (cache == UNKNOWN) {
                continue;
            }
            list.add(cache.getAlias());
        }
        return list;
    }

    /**
     * 判断是否是回款单类型
     * @param businessType
     * @return boolean
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static boolean checkPaymentSheet(Integer businessType) {
        List<Integer> typeList = Arrays.asList(PREPAYMENT_BALANCE.code, PAYMENT_SHEET.code, WRITE_OFF_PREPAYMENT.code, PREPAYMENT.code, RED_PAYMENT_SHEET.code, RED_WRITE_OFF_PREPAYMENT.code, RED_WRITE_OFF_BALANCE.code, RED_PREPAYMENT.code, BAD_DEBT.code);
        return typeList.contains(businessType);
    }
    /**
     * 判断是否是付款单类型
     * @param businessType
     * @return boolean
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static boolean checkPaySheet(Integer businessType) {
        List<Integer> typeList = Arrays.asList(PREPAY_BALANCE.code, PAY_SHEET.code, WRITE_OFF_PREPAY.code, PREPAY.code, RED_WRITE_OFF_PAY.code, RED_WRITE_OFF_PREPAY.code, RED_PREPAY.code, BAD_PAY.code);
        return typeList.contains(businessType);
    }

    /**
     * 判断是否是其他收入单类型
     * @param businessType
     * @return boolean
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static boolean checkOtherIncome(Integer businessType) {
        List<Integer> typeList = Arrays.asList(OTHER_INCOME.code, RED_OTHER_INCOME.code);
        return typeList.contains(businessType);
    }

    /**
     * 判断是否是其他支出单类型
     * @param businessType
     * @return boolean
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static boolean checkOtherExpense(Integer businessType) {
        List<Integer> typeList = Arrays.asList(OTHER_EXPENSE.code, RED_OTHER_EXPENSE.code);
        return typeList.contains(businessType);
    }
    /**
     * @description 判断是否需要重复规则业务
     * @author yanglei
     * @date 2022/11/16 13:42
     * @param businessType
     * @return boolean
     */
    public static boolean checkRecheckRuleBusinessType(Integer businessType) {
        List<Integer> typeList = Arrays.asList(CUSTOMER_MANAGEMENT.code, CLUE.code,CONTACT.code,SALES_OPPORTUNITY.code);
        return typeList.contains(businessType);
    }

    /**
     * @description 判断是否多模板查重业务
     * @author yanglei
     * @date 2022/11/16 13:42
     * @param businessType
     * @return boolean
     */
    public static boolean checkMutiFormRecheckBusinessType(Integer businessType) {
        List<Integer> typeList = Arrays.asList(CUSTOMER_MANAGEMENT.code, CLUE.code,SALES_OPPORTUNITY.code);
        return typeList.contains(businessType);
    }
    /**
     * 判断是否是评分支持的业务类型（客户,线索）
     * @param businessType
     * @return
     */
    public static boolean checkScoreBusinessType(Integer businessType) {
        List<Integer> typeList = Arrays.asList(CUSTOMER_MANAGEMENT.code, CLUE.code);
        return typeList.contains(businessType);
    }

    /**
     * 判断菜单别名是否属于“市场管理”
     * @param alias
     * @return
     */
    public static boolean checkMarketManagementBusinessType(String alias) {
        List<String> aliasList = Arrays.asList(MARKET_ACTIVITY.alias,CLUE.alias,ALL_CLUE.alias,CLUE_PUBLIC.alias,CLUE_RECYCLE.alias);
        return aliasList.contains(alias);
    }

    public String getName() {
        return I18nMessageUtil.getMessage(name);
    }

    public String getI18nName() {
        return name;
    }

    public static Integer transferBusinessType4Distributor(Integer businessType, Integer distributorMark) {
        if (Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && Objects.equals(businessType, CUSTOMER_MANAGEMENT.getCode())) {
            return DISTRIBUTOR_MANAGEMENT.getCode();
        } else if (Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && Objects.equals(businessType, CONTACT.getCode())) {
            return DISTRIBUTOR_CONTACT.getCode();
        } else if (Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && Objects.equals(businessType, CUSTOMER_COMMUNICATE.getCode())) {
            return DISTRIBUTOR_COMMUNICATE.getCode();
        }else if ((Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && Objects.equals(businessType, CONTRACT.getCode()))) {
            return ORDER.getCode();
        }else if ((Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && Objects.equals(businessType, REFUND.getCode()))){
            return RETURN.getCode();
        }else if ((Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && Objects.equals(businessType, CONTRACT_OUTSTOCK.getCode()))){
            return ORDER_OUTSTOCK.getCode();
        }
        return businessType;
    }

    public static Integer transferBusinessType2Index(Integer businessType) {
        if (Objects.equals(businessType, DISTRIBUTOR_MANAGEMENT.getCode())) {
            return CUSTOMER_MANAGEMENT.getCode();
        } else if (Objects.equals(businessType, DISTRIBUTOR_CONTACT.getCode())) {
            return CONTACT.getCode();
        } else if (Objects.equals(businessType, DISTRIBUTOR_COMMUNICATE.getCode())) {
            return CUSTOMER_COMMUNICATE.getCode();
        }else if (Objects.equals(businessType,ORDER.getCode())){
            return CONTRACT.getCode();
        }else if (Objects.equals(businessType,RETURN.getCode())){
            return REFUND.getCode();
        }else if (Objects.equals(businessType,ORDER_OUTSTOCK.getCode())){
            return CONTRACT_OUTSTOCK.getCode();
        }
        return businessType;
    }

    /**
     * 有经销商类型模板，且存在经销商、非经销商类型模板共存（同时展示两种类型模板）情况的业务codeList
     * 注：并不是有经销商模板就要加入返回的list内
     * @return java.util.List<java.lang.Integer>
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static List<Integer> getSpecialBusinesssHasDistributor() {
        return Arrays.asList(XbbRefTypeEnum.PAYMENT.getCode(), XbbRefTypeEnum.INVOICE.getCode(), XbbRefTypeEnum.PAYMENT_TASK.getCode(), XbbRefTypeEnum.PAYMENT_SHEET.getCode(), XbbRefTypeEnum.PREPAYMENT_BALANCE.getCode(), XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode());
    }

    public static boolean isDistributorBusinessType(Integer businessType) {
        return Arrays.asList(XbbRefTypeEnum.DISTRIBUTOR_MANAGEMENT.getCode(), XbbRefTypeEnum.DISTRIBUTOR_ACCOUNT.getCode(), XbbRefTypeEnum.DISTRIBUTOR_COMMUNICATE.getCode(), XbbRefTypeEnum.DISTRIBUTOR_CONTACT.getCode(),
                XbbRefTypeEnum.ORDER.getCode(), XbbRefTypeEnum.RETURN.getCode()).contains(businessType);
    }

    public static boolean isDistributorHasProductBusinessType(Integer businessType) {
        return Arrays.asList(XbbRefTypeEnum.CONTRACT.getCode(), XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.OUTSTOCK.getCode(), XbbRefTypeEnum.REFUND.getCode()).contains(businessType);
    }

    /**
     * 判断传入的业务在menu表内，是否符合同一个businessType，但是distributorMark不同
     * @param businessType
     * @return boolean true，同一个businessType，有两个menu（distributorMark = 0， 1）
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static boolean hasDistributorMenu(Integer businessType) {
        boolean flag = isDistributorBusinessType(businessType);
        //除了经销商菜单本身，客户、合同、退货退款、联系人、跟进记录也可以理解为包含经销商类型菜单
        return flag || Arrays.asList(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode(), XbbRefTypeEnum.CONTRACT.getCode(), XbbRefTypeEnum.REFUND.getCode(), XbbRefTypeEnum.CONTACT.getCode(), XbbRefTypeEnum.CUSTOMER_COMMUNICATE.getCode()).contains(businessType);
    }

    /**
     * 后置进审批的业务
     * @param businessType
     * @return
     */
    public static boolean postPositionBusinessType(Integer businessType, Integer distributorMark) {
        return Objects.equals(distributorMark, DistributorMarkEnum.DISTRIBUTOR.getCode()) && (checkPaymentSheet(businessType) || Arrays.asList(XbbRefTypeEnum.INVOICE.getCode(), XbbRefTypeEnum.REFUND.getCode(), XbbRefTypeEnum.CREDIT_TEMPORARY_LIMIT.getCode()).contains(businessType));
    }

    /**
     * 判断是否有回收站
     * @param saasMark
     * @param businessType
     * @return true：有；false：没有
     */
    public static boolean hasRecyleBin(Integer saasMark, Integer businessType) {
        if (Objects.equals(SaasMarkEnum.PAAS.getCode(), saasMark)) {
            return true;
        } else if (Arrays.asList(CUSTOMER_MANAGEMENT.code, CLUE.code).contains(businessType)) {
            return true;
        }
        return false;
    }

    /**
     * 判断是否支持阶段推进器
     * Paas表单和Saas表单中的客户、机会、线索、合同是支持阶段推进器的
     *
     * @param saasMark      Saas还是Paas标识
     * @param businessType  业务类型
     * @return true/fasle-支持/不支持
     */
    public static boolean isSupportStageProcess(Integer saasMark, Integer businessType) {
        return Objects.equals(SaasMarkEnum.PAAS.getCode(), saasMark) ||
                (Objects.equals(SaasMarkEnum.SAAS.getCode(), saasMark) && Arrays.asList(CUSTOMER_MANAGEMENT.code, CLUE.code, SALES_OPPORTUNITY.code, CONTRACT.code).contains(businessType));
    }

    /**
     * 多个表单模板业务
     * @param businessType
     * @return
     */
    public static boolean isSupportMultipleForm(Integer businessType) {
        return Objects.equals(businessType, XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode()) || Objects.equals(businessType, XbbRefTypeEnum.CONTRACT.getCode()) || Objects.equals(businessType, XbbRefTypeEnum.SALES_OPPORTUNITY.getCode()) || Objects.equals(businessType, XbbRefTypeEnum.CLUE.getCode()) || Objects.equals(XbbRefTypeEnum.WORK_ORDER_V2.getCode(), businessType);
    }

    /**
     * 工作报告模板业务
     * @param businessType
     * @return
     */
    public static boolean isWorkReportForm(Integer businessType) {
        return Objects.equals(businessType, XbbRefTypeEnum.WORK_REPORT.getCode()) || Objects.equals(businessType, XbbRefTypeEnum.WORKREPORT_DAILY.getCode()) || Objects.equals(businessType, XbbRefTypeEnum.WORKREPORT_WEEKLY.getCode()) || Objects.equals(businessType, XbbRefTypeEnum.WORKREPORT_MONTHLY.getCode());
    }

    /**
     * 支持审批的业务
     */
    public static List<Integer> supportApprovalBusiness() {
        List<Integer> list = new ArrayList<>(Arrays.asList(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode(), XbbRefTypeEnum.CONTRACT.getCode(), XbbRefTypeEnum.SALES_OPPORTUNITY.getCode(), XbbRefTypeEnum.CONTACT.getCode(),
                XbbRefTypeEnum.REFUND.getCode(), XbbRefTypeEnum.SUPPLIER.getCode(), XbbRefTypeEnum.SUPPLIER_CONTACT.getCode(), XbbRefTypeEnum.PURCHASE.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE.getCode(), XbbRefTypeEnum.BOM_BILL.getCode(),
                XbbRefTypeEnum.PRODUCTION_ORDER.getCode(), XbbRefTypeEnum.ASSEMBLE.getCode(), XbbRefTypeEnum.INVENTORY.getCode(), XbbRefTypeEnum.TRANSFER.getCode(), XbbRefTypeEnum.QUOTATION.getCode(),
                XbbRefTypeEnum.INSTOCK.getCode(), XbbRefTypeEnum.PURCHASE_INSTOCK.getCode(), XbbRefTypeEnum.REFUND_INSTOCK.getCode(), XbbRefTypeEnum.OTHER_INSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode(), XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode(),
                XbbRefTypeEnum.OUTSTOCK.getCode(), XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode(), XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode(), XbbRefTypeEnum.OTHER_OUTSTOCK.getCode(), XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode(), XbbRefTypeEnum.WORK_ORDER_OUTSTOCK.getCode(),
                XbbRefTypeEnum.INVOICE.getCode(), XbbRefTypeEnum.PURCHASE_INVOICE.getCode(), XbbRefTypeEnum.PAYMENT_SHEET.getCode(), XbbRefTypeEnum.PAY_SHEET.getCode(), XbbRefTypeEnum.MARKET_ACTIVITY.getCode(), XbbRefTypeEnum.CLUE.getCode(),
                XbbRefTypeEnum.CREDIT_TEMPORARY_LIMIT.getCode(), XbbRefTypeEnum.CREDIT_FIXED_LIMIT.getCode(), XbbRefTypeEnum.OTHER_INCOME.getCode(), XbbRefTypeEnum.OTHER_EXPENSE.getCode(), XbbRefTypeEnum.FUND_TRANSFER.getCode(), XbbRefTypeEnum.WORK_ORDER.getCode(), XbbRefTypeEnum.COST_ADJUST.getCode(), XbbRefTypeEnum.COMPETITOR.getCode()));
        list.addAll(workOrderV2SupportApproval());
        return list;
    }

    public static List<Integer> workOrderV2SupportApproval() {
        return new ArrayList<>(Arrays.asList(
                // 工单v2
                XbbRefTypeEnum.WORK_ORDER_V2.getCode(), XbbRefTypeEnum.RECEIPT_ORDER.getCode(), XbbRefTypeEnum.SERVICE_PROJECT.getCode()
        ));
    }

    public static List<Integer> workOrderV2Form() {
        return new ArrayList<>(Arrays.asList(
                // 工单v2
                XbbRefTypeEnum.WORK_ORDER_V2.getCode(), XbbRefTypeEnum.RECEIPT_ORDER.getCode(), XbbRefTypeEnum.SERVICE_PROJECT.getCode(), XbbRefTypeEnum.SLA_LOG.getCode()
        ));
    }

    public static List<Integer> hasVisibleRangeBusiness() {
        return new ArrayList<>(Arrays.asList(
                // 产品、服务项目
                XbbRefTypeEnum.PRODUCT.getCode(), XbbRefTypeEnum.SERVICE_PROJECT.getCode()
        ));
    }

    /**
     * 包含产品的表单
     * @param businessType
     * @return
     */
    public static boolean hasProductForm(Integer businessType) {
        if (Objects.isNull(businessType)) {
            return false;
        }
        return Objects.equals(businessType, XbbRefTypeEnum.SALES_OPPORTUNITY.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.CONTRACT.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.QUOTATION.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.REFUND.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.PURCHASE.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.RETURNED_PURCHASE.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.BOM_BILL.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.PRODUCTION_ORDER.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.TRANSFER.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.INVENTORY.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.ASSEMBLE.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.WORK_ORDER.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.ORI_STOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.COST_ADJUST.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.CONTRACT_OUTSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.REFUND_INSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.PRODUCTION_MATERIEL_OUTSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.RETURNED_MATERIEL_INSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.PURCHASE_INSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.RETURNED_PURCHASE_OUTSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.PRODUCTION_INSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.OTHER_OUTSTOCK.getCode())
                || Objects.equals(businessType, XbbRefTypeEnum.OTHER_INSTOCK.getCode())
                ;
    }

    /**
     * 判断业务是否没有团队表
     * @param businessType
     * @return boolean true 无团队表
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static boolean noTbUser(Integer businessType){
        return noTbUser().contains(businessType);
    }
    /**
     * 无团队表的业务类型集合
     * @return java.util.List<java.lang.Integer>
     * @author zcp
     * @since v1.0
     * @version v1.0
     */
    public static List<Integer> noTbUser(){
        return  //销项发票、进项发票
                Arrays.asList(INVOICE.code, PURCHASE_INVOICE.code
                //采购退货
                , RETURNED_PURCHASE.code
                //资金调拨单
                , FUND_TRANSFER.code
                //装配出入库单
                , ASSEMBLE.code
                //入库单相关
                , INSTOCK.code
                , PURCHASE_INSTOCK.code
                , REFUND_INSTOCK.code
                , OTHER_INSTOCK.code
                , PRODUCTION_INSTOCK.code
                , RETURNED_MATERIEL_INSTOCK.code
                //出库单相关
                , OUTSTOCK.code
                , CONTRACT_OUTSTOCK.code
                , ORDER_OUTSTOCK.code
                , RETURNED_PURCHASE_OUTSTOCK.code
                , PRODUCTION_MATERIEL_OUTSTOCK.code
                , OTHER_OUTSTOCK.code
                , WORK_ORDER_OUTSTOCK.code
                //调拨单
                , TRANSFER.code
                //盘点单
                , INVENTORY.code
                //成本调整单
                , COST_ADJUST.code
        );
    }
}
